<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>大学课程 | 嵌入式智能大棚监测管理系统 | Justlovesmile's BLOG</title><meta name="keywords" content="python,大学课程,Arduino,嵌入式"><meta name="author" content="Justlovesmile,865717150@qq.com"><meta name="copyright" content="Justlovesmile"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="我又肝完了一门课，嵌入式课程设计&#x3D;&#x3D;&gt;基于Proteus，Arduino，Flask搭建的智能大棚管理系统  源程序👇Github🔗Gitee🔗  智能大棚监测管理系统简介1.主要内容 硬件嵌入式系统：采用FreeRTOS实时系统和Arduino UNO平台，以及ATMEGA328P微控制器，进行控制，结合DHT11,BMP180等多种传感器进行数据监测，具有自动控制和监测警报功能，能"><meta property="og:type" content="article"><meta property="og:title" content="大学课程 | 嵌入式智能大棚监测管理系统"><meta property="og:url" content="https://blog.justlovesmile.top/posts/14495.html"><meta property="og:site_name" content="Justlovesmile&#39;s BLOG"><meta property="og:description" content="我又肝完了一门课，嵌入式课程设计&#x3D;&#x3D;&gt;基于Proteus，Arduino，Flask搭建的智能大棚管理系统  源程序👇Github🔗Gitee🔗  智能大棚监测管理系统简介1.主要内容 硬件嵌入式系统：采用FreeRTOS实时系统和Arduino UNO平台，以及ATMEGA328P微控制器，进行控制，结合DHT11,BMP180等多种传感器进行数据监测，具有自动控制和监测警报功能，能"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png"><meta property="article:published_time" content="2020-06-24T04:23:47.000Z"><meta property="article:modified_time" content="2020-06-24T04:23:47.000Z"><meta property="article:author" content="Justlovesmile"><meta property="article:tag" content="python"><meta property="article:tag" content="大学课程"><meta property="article:tag" content="Arduino"><meta property="article:tag" content="嵌入式"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png"><link rel="shortcut icon" href="/img/logo.jpg"><link rel="canonical" href="https://blog.justlovesmile.top/posts/14495"><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//hm.baidu.com"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload='this.media="all"'><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?a2ee893562999ebad688b0d82daa100a";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/font/family=Titillium+Web.css" media="print" onload='this.media="all"'><script>const GLOBAL_CONFIG={root:"/",algolia:void 0,localSearch:{path:"search.xml",languages:{hits_empty:"找不到您查询的内容：${query}"}},translate:void 0,noticeOutdate:void 0,highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:400},copy:{success:"复制成功",error:"复制错误",noSupport:"浏览器不支持"},relativeDate:{homepage:!1,post:!1},runtime:"天",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:100,languages:{author:"作者: Justlovesmile",link:"链接: ",source:"来源: Justlovesmile's BLOG",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"你已切换为繁体",cht_to_chs:"你已切换为简体",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"var(--mj-card-bg)",bgDark:"var(--mj-card-bg)",position:"top-right"},source:{justifiedGallery:{js:"https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js",css:"https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css"}},isPhotoFigcaption:!1,islazyload:!0,isAnchor:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"大学课程 | 嵌入式智能大棚监测管理系统",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2020-06-24 12:23:47"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const a=864e5*o,n={value:t,expiry:(new Date).getTime()+a};localStorage.setItem(e,JSON.stringify(n))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise((t,o)=>{const a=document.createElement("script");a.src=e,a.async=!0,a.onerror=o,a.onload=a.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},document.head.appendChild(a)}),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme"),o=(new Date).getHours();void 0===t?o<=6||o>=18?activateDarkMode():activateLightMode():"light"===t?activateLightMode():activateDarkMode();/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css"><link rel="stylesheet" href="/css/justlovesmile.css"><link rel="stylesheet" href="/css/blogicon.css"><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="Justlovesmile's BLOG" type="application/atom+xml"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="" data-lazy-src="/img/avatar.jpg" onerror='onerror=null,src="/img/friend_404.gif"' alt="avatar"></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">75</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">69</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>网站</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/"><i class="fa-fw fas fa-home"></i> <span>首页</span></a></li><li><a class="site-page child" href="/guestbook/"><i class="fa-fw fas fa-pencil-alt"></i> <span>留言</span></a></li><li><a class="site-page child" href="/friends/"><i class="fa-fw fas fa-paper-plane"></i> <span>友链</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>文库</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>全部标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>全部分类</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-calendar"></i> <span>文章列表</span></a></li><li><a class="site-page child" href="/random/"><i class="fa-fw fas fa-shoe-prints"></i> <span>随便逛逛</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>实验室</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/laboratory/"><i class="fa-fw fa fa-lightbulb-o"></i> <span>项目展示</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa fa-puzzle-piece"></i> <span>友链订阅</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa fa-pie-chart"></i> <span>博客统计</span></a></li><li><a class="site-page child" href="/update/"><i class="fa-fw fa fa-commenting-o"></i> <span>更新日志</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/photos/"><i class="fa-fw fas fa-camera-retro"></i> <span>相册</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fa fa-video-camera"></i> <span>视频</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i> <span>歌单</span></a></li><li><a class="site-page child" href="/focus/"><i class="fa-fw fa fa-check-square-o"></i> <span>关注</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>关于</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fas fa-user"></i> <span>本站</span></a></li><li><a class="site-page child" href="/love/"><i class="fa-fw fa fa-heart"></i> <span>Love</span></a></li><li><a class="site-page child" href="/donate/"><i class="fa-fw fa fa-gratipay"></i> <span>打赏</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url(https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png)"><nav id="nav"><div id="nav-group"><div id="blog_name"><a id="site-name" href="/">Justlovesmile</a></div><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>网站</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/"><i class="fa-fw fas fa-home"></i> <span>首页</span></a></li><li><a class="site-page child" href="/guestbook/"><i class="fa-fw fas fa-pencil-alt"></i> <span>留言</span></a></li><li><a class="site-page child" href="/friends/"><i class="fa-fw fas fa-paper-plane"></i> <span>友链</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>文库</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>全部标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>全部分类</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-calendar"></i> <span>文章列表</span></a></li><li><a class="site-page child" href="/random/"><i class="fa-fw fas fa-shoe-prints"></i> <span>随便逛逛</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>实验室</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/laboratory/"><i class="fa-fw fa fa-lightbulb-o"></i> <span>项目展示</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa fa-puzzle-piece"></i> <span>友链订阅</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa fa-pie-chart"></i> <span>博客统计</span></a></li><li><a class="site-page child" href="/update/"><i class="fa-fw fa fa-commenting-o"></i> <span>更新日志</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/photos/"><i class="fa-fw fas fa-camera-retro"></i> <span>相册</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fa fa-video-camera"></i> <span>视频</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i> <span>歌单</span></a></li><li><a class="site-page child" href="/focus/"><i class="fa-fw fa fa-check-square-o"></i> <span>关注</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><span>关于</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fas fa-user"></i> <span>本站</span></a></li><li><a class="site-page child" href="/love/"><i class="fa-fw fa fa-heart"></i> <span>Love</span></a></li><li><a class="site-page child" href="/donate/"><i class="fa-fw fa fa-gratipay"></i> <span>打赏</span></a></li></ul></div></div></div><div id="nav-right"><div id="search-button"><a class="nav-rightbutton site-page social-icon search"><i class="fas fa-search fa-fw"></i></a></div><div id="darkmode_navswitch"><a class="nav-rightbutton site-page darkmode_switchbutton" onclick="switchDarkMode()"><i class="fas fa-adjust"></i></a></div><div id="toggle-menu"><a class="nav-rightbutton site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></div></nav><div class="coverdiv" id="coverdiv"><img class="cover entered loading" id="post-cover" alt="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png"></div><div id="post-info"><div class="post-firstinfo" id="post-meta"><span class="post-meta-categories"><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/python/">#python</a><a class="post-meta__tags" href="/tags/%E5%A4%A7%E5%AD%A6%E8%AF%BE%E7%A8%8B/">#大学课程</a><a class="post-meta__tags" href="/tags/Arduino/">#Arduino</a><a class="post-meta__tags" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F/">#嵌入式</a></div></div><h1 class="post-title">大学课程 | 嵌入式智能大棚监测管理系统</h1><div id="post-meta"><div class="meta-firstline"><span class="meta-share-time"><span class="meta-avatar"><a class="meta-avatar-img" href="/about/" title="关于作者"><img alt="作者头像" src="" data-lazy-src="/img/avatar.jpg"></a><a class="meta-avatar-name" href="/about/" title="关于作者">Justlovesmile</a></span></span><span class="post-meta-date"><i class="fa-fw post-meta-icon far fa-calendar-alt"></i><span class="post-meta-label">发表于</span><time datetime="2020-06-24T04:23:47.000Z" title="发表于 2020-06-24 12:23:47">2020-06-24</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">5.5k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>17分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>我又肝完了一门课，<strong>嵌入式课程设计</strong>==&gt;基于Proteus，Arduino，Flask搭建的<strong>智能大棚管理系统</strong><br><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png"></p><blockquote><p>源程序👇<br><a target="_blank" rel="external nofollow noopener noreferrer" href="https://github.com/Justlovesmile/Greenhouse-management-system">Github🔗</a><br><a target="_blank" rel="external nofollow noopener noreferrer" href="https://gitee.com/justlovesmile/Greenhouse-management-system">Gitee🔗</a></p></blockquote><h1 id="智能大棚监测管理系统简介"><a href="#智能大棚监测管理系统简介" class="headerlink" title="智能大棚监测管理系统简介"></a>智能大棚监测管理系统简介</h1><h2 id="1-主要内容"><a href="#1-主要内容" class="headerlink" title="1.主要内容"></a>1.主要内容</h2><ul><li>硬件嵌入式系统：采用FreeRTOS实时系统和Arduino UNO平台，以及ATMEGA328P微控制器，进行控制，结合DHT11,BMP180等多种传感器进行数据监测，具有自动控制和监测警报功能，能通过前端切换工作模式</li><li>数据库：基于Python的pymsql库使用MYSQL数据库，能自动创建数据库，表以及存储和查找数据。</li><li>服务器：基于Python的Flask框架搭建，能控制串口读写</li><li>前端：具有登录检测，数据查询，远程控制功能</li></ul><h2 id="2-采用的工具方法"><a href="#2-采用的工具方法" class="headerlink" title="2.采用的工具方法"></a>2.采用的工具方法</h2><ul><li>Proteus 8.6</li><li>Visual Studio Code</li><li>Arduino</li><li>Python3.8</li><li>MySQL 8.0.15</li></ul><h1 id="我的报告-爆肝"><a href="#我的报告-爆肝" class="headerlink" title="我的报告(爆肝)"></a>我的报告(爆肝)</h1><div style="text-align:center"><h1>智能大棚设计与实现</h1></div><p><strong>摘要：</strong>随着社会的不断发展，传统的农业生产活动方式，诸如农民亲自灌溉，施肥，搭棚保温的方式，这些落后的生产方式已经不能满足现代的经济发展需求，智能化，信息化的农业设计成为了农业发展的趋势。本文设计了一款简单易操作的智能大棚环境监测管理系统，能适用于温室大棚的数据监控和远程硬件操作功能，该系统基于嵌入式系统设计方法，使用了RTOS和Arduino UNO微处理器作为系统的主控芯片，使用了DHT11温湿度传感器，LDR光敏电阻，BMP180气压传感器作为外界环境监测模块，使用了COMPIM进行串口通信，结合Flask服务器框架和MySQL数据库，搭建了Web端和数据库，并优化了前端界面。实现了传感器对环境数据和设备数据进行收集分析处理后，通过串口存储于数据库中，用户通过前端网页实时监测环境数据，并可以控制硬件的状态。该智能大棚监测管理系统，简单易操作，智能化程度高，功能完备，十分适用于农业大棚的监测与管理。</p><p><strong>关键词：</strong>嵌入式；智能大棚；传感器；服务器；Arduino</p><h2 id="一，系统简介"><a href="#一，系统简介" class="headerlink" title="一，系统简介"></a><strong>一，系统简介</strong></h2><p>为了实现农业温室大棚的自动化，智能化管理，设计了智能大棚监测管理系统，该系统是基于嵌入式设计技术，利用了Arduino Uno平台，虚拟仿真实验环境Proteus软件，实时操作系统FreeRTOS，实现硬件及Arduino虚拟开发和仿真，根据传感器的检测值，进行判断处理，具有自动控制硬件调节功能和警报功能，再结合Python的Flask库搭建服务器端，serial库进行硬件和服务器端信息传输，以及MySQL进行数据存储，实现了对大棚内温度，湿度，光照，气压的监测和记录，以及对硬件设备，如风机，除湿器，照明，气泵的运行状态的监测和管理，能在Web端实时显示环境和设备运行数据和选择自动以及手动控制硬件的模式，能在前端控制硬件运行，能从数据库选择获取不同时间段的数据并以图表形式展示，并且具有登录登出功能。该系统操作简单，不需耗费大量人力物力学习掌握，能满足正常的数据监控和远程管理以及自动管理需要。</p><h2 id="二，需求分析和概要设计"><a href="#二，需求分析和概要设计" class="headerlink" title="二，需求分析和概要设计"></a><strong>二，需求分析和概要设计</strong></h2><h3 id="1-需求分析"><a href="#1-需求分析" class="headerlink" title="1.需求分析"></a>1.需求分析</h3><p>在当今智能化的背景下，传统的管理方式已经无法满足对温室大棚的实时监测和控制，尤其是因为当今的温室大棚种植面积普遍较大的，因此，从用户的角度出发，对于大棚的管理，最重要的就是实时监测处理大棚内的温度，湿度，光照和棚内气压等数据，这就需要智能大棚管理系统具有对环境的敏感性和监测的实时性，对于用户而言，他可能还需要了解最近一段时间棚内环境的变换以对未来可能发生的情况进行提前预测，以及了解设备的运行情况做出相应更换等措施，因此需要保存环境和设备运行状况的历史数据。并且系统还应该具有智能处理的功能，当环境变量发生改变，处于不适宜大棚内作物生长的环境时，系统还应该自动控制设备进行相应操作。除此以外，系统需要具有简单易操作，低成本的特点，这样才能减少人工看护和操作的费用，降低成本。对于远程在外的用户，还可以通过云平台进行实时监测和设备控制，从而实现对大棚的智能化，自动化监测管理。</p><h3 id="2-概要设计"><a href="#2-概要设计" class="headerlink" title="2.概要设计"></a>2.概要设计</h3><p>通过上文对需求的分析，可以得出，智能大棚监测管理系统应该具有数据监控模块，数据传输模块，控制模块，警报模块，数据库模块，服务器模块以及前端模块，系统功能结构框图如图2.1所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624114845.png"></p><p>图2.1 系统功能结构框图</p><h4 id="2-1-数据监控模块"><a href="#2-1-数据监控模块" class="headerlink" title="2.1 数据监控模块"></a>2.1 数据监控模块</h4><p>数据监控是本系统最为重要的一环，数据的获取主要通过三种器件，包括DHT11温湿度传感器，LDR光敏电阻以及BMP180气压传感器，它们在Proteus软件示意图如图2.2所示。数据监控模块的逻辑控制流程图如图2.3所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624114924.png"></p><p>图2.2 DHT11(左上),LDR(左下),BMP180(右上)在Proteus中的示意图</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624114940.png"></p><p>图2.3 数据监控控制流程图</p><p>由流程图可以看出，数据监控模块主要依靠不断读取三个传感器对温度，湿度，光照，气压的数据信息实现。</p><h4 id="2-2-数据传输模块"><a href="#2-2-数据传输模块" class="headerlink" title="2.2 数据传输模块"></a>2.2 数据传输模块</h4><p>数据传输模块包括了，硬件端传输数据到数据库以及服务器端传输数据到硬件两个部分。</p><h5 id="2-2-1-硬件到数据库"><a href="#2-2-1-硬件到数据库" class="headerlink" title="2.2.1 硬件到数据库"></a>2.2.1 硬件到数据库</h5><p>硬件端到数据库之间的数据传输主要是为了进行数据存储，因此需要规定硬件写入到串口的格式，并传到服务器端接受，按照规定的格式解析并存储到数据库，硬件到数据库的数据传输流程图如图2.4所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115022.png"></p><p>图2.4 硬件到数据库的数据传输流程图</p><h5 id="2-2-2-服务器到硬件"><a href="#2-2-2-服务器到硬件" class="headerlink" title="2.2.2 服务器到硬件"></a>2.2.2 服务器到硬件</h5><p>服务器端到硬件的数据传输主要是为了传输前端的控制信息，包括控制选择自动与手动模式，是否开启或关闭相应硬件等控制信息，服务器到硬件的数据传输流程图如图2.5所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115155.png"></p><p>图2.5 服务器到硬件的数据传输流程图</p><h4 id="2-3-控制模块"><a href="#2-3-控制模块" class="headerlink" title="2.3 控制模块"></a>2.3 控制模块</h4><p>控制模块包括了自动控制模块和手动控制模块。</p><h5 id="2-3-1-自动控制模块"><a href="#2-3-1-自动控制模块" class="headerlink" title="2.3.1 自动控制模块"></a>2.3.1 自动控制模块</h5><p>当硬件第一次运行时，默认为自动模式，此时，数据监控时会根据设定的危险范围进行相应的操作，例如当温度超过某个值时，打开风机，否则关闭风机，当湿度超过某个值时，打开除湿器，否则关闭除湿器，自动控制流程图如图2.6所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115306.png"></p><p>图2.6 自动控制流程图</p><h5 id="2-3-2-手动控制模块"><a href="#2-3-2-手动控制模块" class="headerlink" title="2.3.2 手动控制模块"></a>2.3.2 手动控制模块</h5><p>当服务器端传进来的数据为9时，关闭自动模式，此时硬件运行状态通过之后服务器端传来的数据控制，不同的数据对应不同的操作，手动控制流程图如图2.7所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115328.png"></p><p>图2.7 手动控制流程图</p><h4 id="2-4-警示灯模块"><a href="#2-4-警示灯模块" class="headerlink" title="2.4 警示灯模块"></a>2.4 警示灯模块</h4><p>为了更好的提醒用户温室大棚内的环境是否正常，设置了警示灯模块，通过不断获取环境数据并和危险区间的上下界进行比较，执行相应的警示灯亮起或熄灭操作，警示灯流程图如图2.8所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115347.png"></p><p>图2.8 警示灯流程图</p><h4 id="2-5-数据库模块"><a href="#2-5-数据库模块" class="headerlink" title="2.5 数据库模块"></a>2.5 数据库模块</h4><p>数据库模块主要是编写成数据库相关的API，在前端点击，或者自动更新后将会向服务器端请求数据，然后服务器端调用数据库API执行相应的操作，包括：数据库和表的创建，初始用户数据导入，插入数据，按次数搜索最新数据，按时间搜索范围内的数据等等，数据库API结构图如图2.9所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115503.png"></p><p>图2.9 数据库模块API结构图</p><h4 id="2-6-服务器模块"><a href="#2-6-服务器模块" class="headerlink" title="2.6 服务器模块"></a>2.6 服务器模块</h4><p>对于智能大棚管理系统，服务器的作用主要用于响应前端的请求，以及对串口和数据库的连接和处理，当前端发来不同的请求后，服务器进行相应的操作，包括，返回HTML页面，调用数据库API以及对串口的读取和写入，打开和关闭操作，其具体的功能结构图如图2.10所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115452.png"></p><p>图2.10 服务器功能结构图</p><h4 id="2-7-前端模块"><a href="#2-7-前端模块" class="headerlink" title="2.7 前端模块"></a>2.7 前端模块</h4><p>智能大棚系统的前端部分主要功能是展示环境数据和设备数据，通过向服务器端请求不同数据，实现对两种数据的最新一条数据和最近一小时数据，最近三小时数据，最近一天数据，最近两天数据的获取，并用折线图，柱状图和表格的形式展示，并且前端会像服务器请求登录状态，如果没有登陆则会自动跳转到登陆页面，保障了用户的信息安全，登录后用户可以通过前端监测数据，并且选择登出，打开或关闭自动模式，打开或关闭风机等硬件设备的功能，除此之外，前端还能每个一段时间自动更新，具体的功能结构图如图2.11所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115534.png"></p><p>图2.11 前端功能结构图</p><h2 id="三，系统设计与实现"><a href="#三，系统设计与实现" class="headerlink" title="三，系统设计与实现"></a><strong>三，系统设计与实现</strong></h2><h3 id="1-硬件设计与实现"><a href="#1-硬件设计与实现" class="headerlink" title="1.硬件设计与实现"></a>1.硬件设计与实现</h3><h4 id="1-1-硬件总体电路原理图"><a href="#1-1-硬件总体电路原理图" class="headerlink" title="1.1 硬件总体电路原理图"></a>1.1 硬件总体电路原理图</h4><p>硬件电路主要依靠Proteus软件，仿真实现，如图3.1所示。其中包括了DHTT11温湿度传感器用于获取大棚内的温度和湿度；LDR，其阻值随光照强度的增大而减小，将其与一个10K电阻组成分压电路，使得读取模拟IO的电压值可以用于监测大棚内的光照强度；BMP180，是一种高精度的气压传感器，用于监测大棚内气压。D2,D3,D4,D5为警示灯，D6,D7,D8,D9依次模拟风机，除湿器，照明，气泵设备。COMPIM用于串口通信。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115623.png"></p><p>图3.1 硬件总体设计</p><h4 id="1-2-硬件系统设计"><a href="#1-2-硬件系统设计" class="headerlink" title="1.2 硬件系统设计"></a>1.2 硬件系统设计</h4><p>硬件系统采用免费的实时系统FreeRTOS，其通过创建任务并调度实现系统的主要程序，在智能大棚系统中，硬件系统首先配置一系列IO口，定义了一些全局变量，如传感器的引脚，电压变量，所选择的智能模式，led端口等等，通过start_task()任务创建总任务zong_task()，在总任务内，不断读取串口传来的数据和传感器的数值，并写入串口，传递给服务器。</p><h5 id="1-2-1-数据监控与传输"><a href="#1-2-1-数据监控与传输" class="headerlink" title="1.2.1 数据监控与传输"></a>1.2.1 数据监控与传输</h5><p>在zong_task()中，程序在延迟3秒后依次读取每个传感器的值，并通过串口传递固定格式的数据，最终传递的数据格式，如图3.2所示，依次分别代表温度，湿度，光强，气压，自动模式，风机状态，除湿器状态，照明状态，气泵状态。读取传感器的函数如下所示。</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">delay</span>(<span class="number">3000</span>); <span class="comment">//每隔3s更新一次数据</span></span><br><span class="line"><span class="keyword">float</span> h = dht.<span class="built_in">readHumidity</span>();   <span class="comment">//读取湿度</span></span><br><span class="line"><span class="keyword">float</span> t = dht.<span class="built_in">readTemperature</span>(); <span class="comment">//读取温度</span></span><br><span class="line">var = <span class="built_in">analogRead</span>(LDR_PIN);   <span class="comment">//读取光照强度</span></span><br><span class="line">Serial.<span class="built_in">print</span>(bmp.<span class="built_in">readSealevelPressure</span>());  <span class="comment">//读取气压值</span></span><br><span class="line">Serial.<span class="built_in">print</span>(<span class="built_in">digitalRead</span>(led_pin[<span class="number">4</span>])); <span class="comment">//读取并传输硬件（其一）运行状态</span></span><br></pre></td></tr></table></figure><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624115737.png"></p><p>图3.2 数据传输格式</p><h5 id="1-2-2-自动控制和手动控制"><a href="#1-2-2-自动控制和手动控制" class="headerlink" title="1.2.2 自动控制和手动控制"></a>1.2.2 自动控制和手动控制</h5><p>程序定义了一个bool类型的全局变量MYBOOL，用于表示当前模式是自动还是手动，当模式是自动时，串口读入的数据将不能控制硬件状态改变，只能控制模式的改变，此时，硬件系统将根据传感器的值进行自动打开或关闭硬件设备，而当模式是手动时，则只能通过串口读入的值来控制硬件设备的开启与关闭。定义的读入手动控制操作的伪代码如下：</p><figure class="highlight haskell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">While</span>(<span class="type">Serial</span>.available())&#123;</span><br><span class="line">    读取<span class="class"><span class="keyword">data</span></span></span><br><span class="line">    如果为自动模式&#123;</span><br><span class="line">        当<span class="class"><span class="keyword">data</span>=9时，关闭自动模式</span></span><br><span class="line">&#125;</span><br><span class="line">如果为手动模式&#123;</span><br><span class="line">    当<span class="class"><span class="keyword">data</span>=1时，打开风机</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=2时，关闭风机</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=3时，打开除湿</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=4时，关闭除湿</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=5时，打开灯光</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=6时，关闭灯光</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=7时，打开气泵</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=8时，关闭气泵</span></span><br><span class="line">当<span class="class"><span class="keyword">data</span>=0时，切换自动模式</span></span><br><span class="line">&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>定义的自动控制和警报操作伪代码如下：</p><figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="title">If</span><span class="params">(自动模式)</span></span>&#123;</span><br><span class="line">    如果温度异常，警报灯亮，操作风机，否则关闭警报灯和风机</span><br><span class="line">    如果湿度异常，警报灯亮，操作除湿器，否则关闭警报灯和除湿</span><br><span class="line">    如果光强异常，警报灯亮，操作照明，否则关闭警报灯和照明</span><br><span class="line">    如果气压异常，警报灯亮，操作气泵，否则关闭警报灯和气泵</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="2-数据库设计与实现"><a href="#2-数据库设计与实现" class="headerlink" title="2.数据库设计与实现"></a>2.数据库设计与实现</h3><p>数据库的连接与操作，主要使用了Python的pymysql库，以及MYSQL数据库，主要实现当服务器连接时，自动查找大棚数据库，如果不存在则自动创建数据库BigPeng和三张数据表users,logs,e_logs,分别记录用户，环境数据，设备数据，并且提供了基于SQL语句的数据插入，数据查询功能，并有良好的异常处理机制。其中环境数据表的创建如下所示：</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">cur.execute(<span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">        create table `logs`(</span></span><br><span class="line"><span class="string">            `log_id` int(11) unsigned unique NOT NULL AUTO_INCREMENT,</span></span><br><span class="line"><span class="string">            `time` char(20) not null,</span></span><br><span class="line"><span class="string">            `temperature` float(2),</span></span><br><span class="line"><span class="string">            `humidity` float(2),</span></span><br><span class="line"><span class="string">            `light` float(2),</span></span><br><span class="line"><span class="string">            `pressure` float(2),</span></span><br><span class="line"><span class="string">            PRIMARY KEY(`log_id`),</span></span><br><span class="line"><span class="string">            index id(log_id)</span></span><br><span class="line"><span class="string">        )DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1;&quot;&quot;&quot;</span>)</span><br></pre></td></tr></table></figure><p>数据查找主要有两种模式，一种是select_logs(timestamp),其会根据传入的时间戳，查找大于这一个时间的数据，即可以实现查找最近一小时，最近一天等的数据，具体的实现代码如下：</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">select_logs</span>(<span class="params">timestamp</span>):</span></span><br><span class="line">    conn=connect_BigPeng()</span><br><span class="line">    cur=conn.cursor()</span><br><span class="line">    sql=<span class="string">f&quot;select * from logs where time&gt;=<span class="subst">&#123;timestamp&#125;</span>;&quot;</span></span><br><span class="line">    <span class="keyword">try</span>:</span><br><span class="line">        ans=cur.fetchmany(cur.execute(sql))</span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        conn.close()</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;数据查找失败！&quot;</span>)</span><br><span class="line">        <span class="built_in">print</span>(e)</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">False</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        conn.close()</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;数据查找成功&quot;</span>)</span><br><span class="line">        <span class="keyword">return</span> ans</span><br></pre></td></tr></table></figure><p>第二种是select_newlogs(index),其会根据传入的数量，按照时间倒序，查找最新的index条数据，具体的代码如下：</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">select_newlogs</span>(<span class="params">index</span>):</span></span><br><span class="line">    conn=connect_BigPeng()</span><br><span class="line">    cur=conn.cursor()</span><br><span class="line">    sql=<span class="string">f&quot;select * from logs order by time desc limit 0,<span class="subst">&#123;index&#125;</span>;&quot;</span></span><br><span class="line">    <span class="keyword">try</span>:</span><br><span class="line">        ans=cur.fetchmany(cur.execute(sql))</span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        conn.close()</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;数据查找失败！&quot;</span>)</span><br><span class="line">        <span class="built_in">print</span>(e)</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">False</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        conn.close()</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;数据查找成功&quot;</span>)</span><br><span class="line">        <span class="keyword">return</span> ans</span><br></pre></td></tr></table></figure><h3 id="3-服务器设计与实现"><a href="#3-服务器设计与实现" class="headerlink" title="3.服务器设计与实现"></a>3.服务器设计与实现</h3><h4 id="3-1-串口连接和数据插入"><a href="#3-1-串口连接和数据插入" class="headerlink" title="3.1 串口连接和数据插入"></a>3.1 串口连接和数据插入</h4><p>服务器端的串口操作，主要运用了python的serial库和threading库，serial用于串口通信交互。而threading用于使用多线程循环接受串口数据，并存储到数据库中。<br>串口的操作部分，主要功能有，打开串口DopenPort(portx,bps,timeout)，读取数据ReadData(ser)，关闭串口DclosePort(ser)，写入数据DWritePort(ser,text)四个部分。<br>当串口打开后，将会自动执行读取数据操作。具体代码如下：</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 端口，Windows上的 COM2</span></span><br><span class="line"><span class="comment"># 波特率，9600</span></span><br><span class="line"><span class="comment"># 超时设置,None：永远等待操作，0为立即返回请求结果，其他值为等待超时时间(单位为秒）</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">DOpenPort</span>(<span class="params">portx,bps,timeout</span>):</span></span><br><span class="line">    ret=<span class="literal">False</span></span><br><span class="line">    <span class="keyword">try</span>:</span><br><span class="line">        <span class="comment"># 打开串口，并得到串口对象</span></span><br><span class="line">        ser = serial.Serial(portx, bps, timeout=timeout)</span><br><span class="line">        <span class="comment">#print(ser)</span></span><br><span class="line">        <span class="comment">#判断是否打开成功</span></span><br><span class="line">        <span class="keyword">if</span>(ser.is_open):</span><br><span class="line">           ret=<span class="literal">True</span></span><br><span class="line">           threading.Thread(target=ReadData, args=(ser,)).start()</span><br><span class="line">           <span class="comment">#ReadData(ser)</span></span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;---异常---：&quot;</span>, e)</span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        <span class="keyword">return</span> ser,ret</span><br></pre></td></tr></table></figure><h4 id="3-2-服务器框架设计与实现"><a href="#3-2-服务器框架设计与实现" class="headerlink" title="3.2 服务器框架设计与实现"></a>3.2 服务器框架设计与实现</h4><p>该智能大棚系统的服务器端主要使用Python的Flask服务器框架，能够快速接受前端的响应，支持session保存如登录状态等数据，结合之前编写的数据库API以及串口操作函数，能够实现对前端请求数据的获取和传递。其中获取某一时间段的函数如下所示：</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@app.route(<span class="params"><span class="string">&#x27;/getjson/&#x27;</span>,methods=[<span class="string">&#x27;GET&#x27;</span>,<span class="string">&#x27;POST&#x27;</span>]</span>)</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">getjson</span>():</span></span><br><span class="line">    H=<span class="built_in">int</span>(request.form.get(<span class="string">&#x27;Hour&#x27;</span>))</span><br><span class="line">    beforetime=time.strptime((datetime.now()-timedelta(hours=H)).strftime(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>),<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>)</span><br><span class="line">    timestamp=<span class="built_in">int</span>(time.mktime(beforetime))</span><br><span class="line">    <span class="keyword">try</span>:</span><br><span class="line">        ans=dealdata(sqlapi.select_logs(timestamp))</span><br><span class="line">        <span class="comment">#数据处理</span></span><br><span class="line">    <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;Get Json 失败！&quot;</span>)</span><br><span class="line">        <span class="comment">#print(e)</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        <span class="keyword">return</span> json.dumps(ans)</span><br></pre></td></tr></table></figure><p>由于json不支持时间类型的数据解析，因此每次需要服务器端将获取时间并转换为字符串类型的数据进行传递.</p><h3 id="4-前端设计与实现"><a href="#4-前端设计与实现" class="headerlink" title="4.前端设计与实现"></a>4.前端设计与实现</h3><p>前端包含四个页面，即登录页，首页，详细数据页，设备数据页。前端需要导入两个js文件，一个是jQuery,一个是echarts.js，后者主要用于数据图表的显示。<br>前端页面具有登录检测功能，如果没有登录，则会自动跳转到登录页面，部分代码如下：</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">check_session=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            $.get(<span class="string">&#x27;/check_session/&#x27;</span>).done(<span class="function"><span class="keyword">function</span>(<span class="params">ans</span>)</span>&#123;</span><br><span class="line">                data=$.parseJSON(ans);</span><br><span class="line">                <span class="built_in">console</span>.log(data)</span><br><span class="line">                <span class="keyword">if</span>(data[<span class="string">&quot;session&quot;</span>]==<span class="string">&quot;false&quot;</span>)&#123;</span><br><span class="line">                    <span class="built_in">window</span>.location.replace(<span class="string">&quot;/login/&quot;</span>);</span><br><span class="line">                &#125;</span><br><span class="line">                &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>前端具有数据图表以及按钮实时显示功能，每隔一定时间，将会请求服务器再次更新数据，设置定时更新的代码如下：</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">window</span>.onload=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    check_session()</span><br><span class="line">    showdata()</span><br><span class="line">    drawcharts()</span><br><span class="line">    <span class="built_in">setInterval</span>(<span class="string">&quot;showdata()&quot;</span>,<span class="number">5000</span>);</span><br><span class="line">    <span class="built_in">setInterval</span>(<span class="string">&quot;drawcharts()&quot;</span>,<span class="number">5000</span>);</span><br><span class="line">    <span class="built_in">setInterval</span>(<span class="string">&quot;check_session()&quot;</span>,<span class="number">5000</span>);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h2 id="四，系统测试"><a href="#四，系统测试" class="headerlink" title="四，系统测试"></a><strong>四，系统测试</strong></h2><h3 id="1-硬件运行"><a href="#1-硬件运行" class="headerlink" title="1.硬件运行"></a>1.硬件运行</h3><p>当硬件开启后，默认为自动模式，此时如果检测值超过设定的危险值后，警示灯将会点亮，并且运行响应的硬件设备，温度超过范围后自动控制的硬件运行图，如图4.1所示。一切正常时的运行图，如图4.2所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120018.png"></p><p>图4.1 温度超过范围后自动控制的硬件运行图</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120203.png"></p><p>图4.2 正常运行硬件图</p><h3 id="2-服务器运行"><a href="#2-服务器运行" class="headerlink" title="2.服务器运行"></a>2.服务器运行</h3><p>当服务器运行后，将会查找BigPeng数据库是否存在，如果不存在，将会自动创建数据库和表，如果存在，则自动连接数据库，如图4.3所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120236.png"></p><p>图4.3 服务器正常运行示意图</p><h3 id="3-前端运行"><a href="#3-前端运行" class="headerlink" title="3.前端运行"></a>3.前端运行</h3><p>当服务器和硬件系统开启后，进入首页将会自动跳转登录页面，如图4.4所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120259.png"></p><p>图4.4 登陆页面</p><p>输入默认的用户名root和密码123456，即可自动跳转首页，首页上半部分如图4.5所示，下部分如图4.6所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png"></p><p>图4.5 首页上部分示意图</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120459.png"></p><p>图4.6 首页下部分示意图</p><p>此时当服务器第一运行时，串口并没有打开，因此需要点击开始监测按钮才能进行数据记录，按下按钮后，可以看到数据表在实时更新，并且按钮状态已改变，这一将存储到服务器端，不会随刷新而改变，如图4.7所示。并且首页还能控制硬件端的模式和硬件设备的开启与停止，如果点击了关闭自动，并打开风机和气泵，等待几秒后将如图4.8所示，对应的硬件状态如图4.9所示</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120512.png"></p><p>图4.7 开启实时监测</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120524.png"></p><p>图4.8 关闭了自动模式打开风机气泵示意图</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120538.png"></p><p>图4.9 对应打开风机和气泵的硬件状态图</p><p>通过点击导航栏，可以跳转到详细数据页面，里面可以显示最近三小时，最近一天和最近两天的数据，如图4.10所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120700.png"></p><p>图4.10 详细数据页面</p><p>再点击导航栏上的设备详情，即可跳转设备数据页面，同样可以查看最近三小时，最近一天和最近两天的数据，如图4.11所示。</p><p><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120715.png"></p><p>图4.11 设备数据页</p><h2 id="五，总结"><a href="#五，总结" class="headerlink" title="五，总结"></a><strong>五，总结</strong></h2><p>通过对智能大棚监测管理系统的设计，我们团队实现了对系统的全部预期目标，不仅能实时监控环境数据，还能监控硬件运行状态数据，并存储到数据库，并且通过不懈努力，前端页面具有高效的实时性和动态效果，能定时获取数据实时更新数据，前端也会根据数据的不同发生相对应的改变，在实验过程中也遇到了很多问题，但是在查阅了很多文档后，问题都得到了解决，目前需要改进的地方是，硬件端的传感器数量较少，能够实现的功能可以继续增加，其次是前端的数据更新仍需要5到10秒中时间，当点击了打开硬件设备后需要等待较长时间才会更新。这次智能大棚监测管理系统的设计，让我受益匪浅，希望以后的我，能将它继续完善。</p></article><div class="post-reward"><div class="reward-button"><i class="fas fa-hamburger"></i> 打赏作者</div><div class="reward-main"><ul class="reward-all"><ul class="reward-group"><li class="reward-item"><a href="/img/wechat.jpg" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/img/wechat.jpg" alt="微信"></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/img/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/img/alipay.jpg" alt="支付宝"></a><div class="post-qr-code-desc">支付宝</div></li></ul><a class="reward-main-btn" href="/donate"><div class="reward-text">赞赏者名单</div><div class="reward-dec">因为你们的支持让我意识到写文章的价值🙏</div></a></ul></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/python/">python</a><a class="post-meta__tags" href="/tags/%E5%A4%A7%E5%AD%A6%E8%AF%BE%E7%A8%8B/">大学课程</a><a class="post-meta__tags" href="/tags/Arduino/">Arduino</a><a class="post-meta__tags" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F/">嵌入式</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200624120328.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer="defer"></script></div></div><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-info">大学课程 | 嵌入式智能大棚监测管理系统</span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="https://blog.justlovesmile.top/posts/14495.html">https://blog.justlovesmile.top/posts/14495.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="external nofollow noopener noreferrer">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://blog.justlovesmile.top" target="_blank">Justlovesmile's BLOG</a>！</span></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/27831.html"><img class="prev-cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/image/213312-1558704792daa4.jpg" onerror='onerror=null,src="/img/404.jpg"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Hexo博客 | 如何让你的valine更好看</div></div></a></div><div class="next-post pull-right"><a href="/posts/16593.html"><img class="next-cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20200619203709.png" onerror='onerror=null,src="/img/404.jpg"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">大学课程 | 计算机图形学，基于MFC和二维变换的画图软件</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/posts/865c56ba.html" title="目标检测 | 常用数据集标注格式及生成脚本"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/202109111517311.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-09-11</div><div class="title">目标检测 | 常用数据集标注格式及生成脚本</div></div></a></div><div><a href="/posts/bfa4054.html" title="深度学习 | 《深度学习入门之PyTorch》阅读笔记"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2@latest/post/pytorch.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-23</div><div class="title">深度学习 | 《深度学习入门之PyTorch》阅读笔记</div></div></a></div><div><a href="/posts/7c5e3f37.html" title="学习笔记 | CSP201912认证考试部分题解"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/image/202851-1495024131b004.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-07-30</div><div class="title">学习笔记 | CSP201912认证考试部分题解</div></div></a></div><div><a href="/posts/18326.html" title="Python工具 | 用python把excel成绩单拼起来"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/image/1584111974-u41116003233235941168fm26gp0.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-06-10</div><div class="title">Python工具 | 用python把excel成绩单拼起来</div></div></a></div><div><a href="/posts/10294.html" title="Python工具 | pdf转excel的python方法"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/image/225539-156527613945d6.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-06-10</div><div class="title">Python工具 | pdf转excel的python方法</div></div></a></div><div><a href="/posts/52305.html" title="Python爬虫 | 如何获取网易云音乐评论"><img class="cover" src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/image/001243-1573661563c583.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-03-18</div><div class="title">Python爬虫 | 如何获取网易云音乐评论</div></div></a></div></div></div><hr><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="" data-lazy-src="/img/avatar.jpg" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="author-info__name">Justlovesmile</div><div class="author-info__description">一个计算机专业学生的个人博客，记录着学习笔记和生活中的思考，期待着和所有人相遇</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">75</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">69</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content"><p>不定时更新博客，欢迎交换<a href="/friends/"><strong>友链</strong></a>...</p><div class="twopeople"><div class="container" style="height:200px"><canvas class="illo" width="800" height="800" style="max-width:200px;max-height:200px;touch-action:none;width:640px;height:640px"></canvas></div><script src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/js/twopeople1.js"></script><script src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/js/zdog.dist.js"></script><script id="rendered-js" src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/js/twopeople.js"></script><style>.twopeople{margin:0;align-items:center;justify-content:center;text-align:center}canvas{display:block;margin:0 auto;cursor:move}</style></div><div style="text-align:center"><a href="https://www.foreverblog.cn/" target="_blank" rel="external nofollow noopener noreferrer"><img src="" data-lazy-src="https://img.foreverblog.cn/logo_en_default.png" alt="foreverblog" style="width:auto;height:16px"></a></div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%99%BA%E8%83%BD%E5%A4%A7%E6%A3%9A%E7%9B%91%E6%B5%8B%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%AE%80%E4%BB%8B"><span class="toc-text">智能大棚监测管理系统简介</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9"><span class="toc-text">1.主要内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E9%87%87%E7%94%A8%E7%9A%84%E5%B7%A5%E5%85%B7%E6%96%B9%E6%B3%95"><span class="toc-text">2.采用的工具方法</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%88%91%E7%9A%84%E6%8A%A5%E5%91%8A-%E7%88%86%E8%82%9D"><span class="toc-text">我的报告(爆肝)</span></a></li><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-text">智能大棚设计与实现</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%EF%BC%8C%E7%B3%BB%E7%BB%9F%E7%AE%80%E4%BB%8B"><span class="toc-text">一，系统简介</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%EF%BC%8C%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90%E5%92%8C%E6%A6%82%E8%A6%81%E8%AE%BE%E8%AE%A1"><span class="toc-text">二，需求分析和概要设计</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90"><span class="toc-text">1.需求分析</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E6%A6%82%E8%A6%81%E8%AE%BE%E8%AE%A1"><span class="toc-text">2.概要设计</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#2-1-%E6%95%B0%E6%8D%AE%E7%9B%91%E6%8E%A7%E6%A8%A1%E5%9D%97"><span class="toc-text">2.1 数据监控模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-2-%E6%95%B0%E6%8D%AE%E4%BC%A0%E8%BE%93%E6%A8%A1%E5%9D%97"><span class="toc-text">2.2 数据传输模块</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#2-2-1-%E7%A1%AC%E4%BB%B6%E5%88%B0%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">2.2.1 硬件到数据库</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-2-2-%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%88%B0%E7%A1%AC%E4%BB%B6"><span class="toc-text">2.2.2 服务器到硬件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-3-%E6%8E%A7%E5%88%B6%E6%A8%A1%E5%9D%97"><span class="toc-text">2.3 控制模块</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#2-3-1-%E8%87%AA%E5%8A%A8%E6%8E%A7%E5%88%B6%E6%A8%A1%E5%9D%97"><span class="toc-text">2.3.1 自动控制模块</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-3-2-%E6%89%8B%E5%8A%A8%E6%8E%A7%E5%88%B6%E6%A8%A1%E5%9D%97"><span class="toc-text">2.3.2 手动控制模块</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-4-%E8%AD%A6%E7%A4%BA%E7%81%AF%E6%A8%A1%E5%9D%97"><span class="toc-text">2.4 警示灯模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-5-%E6%95%B0%E6%8D%AE%E5%BA%93%E6%A8%A1%E5%9D%97"><span class="toc-text">2.5 数据库模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-6-%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%A8%A1%E5%9D%97"><span class="toc-text">2.6 服务器模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-7-%E5%89%8D%E7%AB%AF%E6%A8%A1%E5%9D%97"><span class="toc-text">2.7 前端模块</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%89%EF%BC%8C%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">三，系统设计与实现</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E7%A1%AC%E4%BB%B6%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">1.硬件设计与实现</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-1-%E7%A1%AC%E4%BB%B6%E6%80%BB%E4%BD%93%E7%94%B5%E8%B7%AF%E5%8E%9F%E7%90%86%E5%9B%BE"><span class="toc-text">1.1 硬件总体电路原理图</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-2-%E7%A1%AC%E4%BB%B6%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1"><span class="toc-text">1.2 硬件系统设计</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#1-2-1-%E6%95%B0%E6%8D%AE%E7%9B%91%E6%8E%A7%E4%B8%8E%E4%BC%A0%E8%BE%93"><span class="toc-text">1.2.1 数据监控与传输</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#1-2-2-%E8%87%AA%E5%8A%A8%E6%8E%A7%E5%88%B6%E5%92%8C%E6%89%8B%E5%8A%A8%E6%8E%A7%E5%88%B6"><span class="toc-text">1.2.2 自动控制和手动控制</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">2.数据库设计与实现</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">3.服务器设计与实现</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#3-1-%E4%B8%B2%E5%8F%A3%E8%BF%9E%E6%8E%A5%E5%92%8C%E6%95%B0%E6%8D%AE%E6%8F%92%E5%85%A5"><span class="toc-text">3.1 串口连接和数据插入</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%A1%86%E6%9E%B6%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">3.2 服务器框架设计与实现</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E5%89%8D%E7%AB%AF%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0"><span class="toc-text">4.前端设计与实现</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%9B%EF%BC%8C%E7%B3%BB%E7%BB%9F%E6%B5%8B%E8%AF%95"><span class="toc-text">四，系统测试</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E7%A1%AC%E4%BB%B6%E8%BF%90%E8%A1%8C"><span class="toc-text">1.硬件运行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E8%A1%8C"><span class="toc-text">2.服务器运行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E5%89%8D%E7%AB%AF%E8%BF%90%E8%A1%8C"><span class="toc-text">3.前端运行</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%94%EF%BC%8C%E6%80%BB%E7%BB%93"><span class="toc-text">五，总结</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/56b0563d.html" title="Hexo博客 | 如何让Butterfly主题导航栏居中"><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20220315095300.png" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="Hexo博客 | 如何让Butterfly主题导航栏居中"></a><div class="content"><a class="title" href="/posts/56b0563d.html" title="Hexo博客 | 如何让Butterfly主题导航栏居中">Hexo博客 | 如何让Butterfly主题导航栏居中</a><time datetime="2022-03-15T01:25:18.000Z" title="发表于 2022-03-15 09:25:18">2022-03-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/bb608df3.html" title="目标检测 | RetinaNet，经典单阶段Anchor-Based目标检测模型"><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20220314113659.png" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="目标检测 | RetinaNet，经典单阶段Anchor-Based目标检测模型"></a><div class="content"><a class="title" href="/posts/bb608df3.html" title="目标检测 | RetinaNet，经典单阶段Anchor-Based目标检测模型">目标检测 | RetinaNet，经典单阶段Anchor-Based目标检测模型</a><time datetime="2022-03-14T03:26:21.000Z" title="发表于 2022-03-14 11:26:21">2022-03-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/fc798de3.html" title="目标检测 | Faster R-CNN，经典两阶段检测模型"><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/20220312220823.png" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="目标检测 | Faster R-CNN，经典两阶段检测模型"></a><div class="content"><a class="title" href="/posts/fc798de3.html" title="目标检测 | Faster R-CNN，经典两阶段检测模型">目标检测 | Faster R-CNN，经典两阶段检测模型</a><time datetime="2022-03-12T13:59:01.000Z" title="发表于 2022-03-12 21:59:01">2022-03-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/d150f284.html" title="深度学习 | 小样本学习基础概念"><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/202201271037441.png" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="深度学习 | 小样本学习基础概念"></a><div class="content"><a class="title" href="/posts/d150f284.html" title="深度学习 | 小样本学习基础概念">深度学习 | 小样本学习基础概念</a><time datetime="2022-01-27T02:24:38.000Z" title="发表于 2022-01-27 10:24:38">2022-01-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/e05a9ab6.html" title="Jupyter Lab | 安装、配置、插件推荐、多用户使用教程"><img src="" data-lazy-src="https://cdn.jsdelivr.net/gh/Justlovesmile/CDN2/post/image-20211125175041150.png" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="Jupyter Lab | 安装、配置、插件推荐、多用户使用教程"></a><div class="content"><a class="title" href="/posts/e05a9ab6.html" title="Jupyter Lab | 安装、配置、插件推荐、多用户使用教程">Jupyter Lab | 安装、配置、插件推荐、多用户使用教程</a><time datetime="2021-11-25T09:38:43.000Z" title="发表于 2021-11-25 17:38:43">2021-11-25</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div id="footer_deal"><a class="social-icon" href="mailto:865717150@qq.com" target="_blank" title="Email" rel="external nofollow noopener noreferrer"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://blog.csdn.net/qq_43701912" target="_blank" title="CSDN" rel="external nofollow noopener noreferrer"><i class="iconfont icon-csdn1"></i></a><a class="social-icon" href="https://github.com/Justlovesmile" target="_blank" title="Github" rel="external nofollow noopener noreferrer"><i class="fab fa-github"></i></a><a class="social-icon" href="https://weibo.com/u/5252319712" target="_blank" title="微博" rel="external nofollow noopener noreferrer"><i class="fa fa-weibo"></i></a><a class="social-icon" href="https://space.bilibili.com/168738824" target="_blank" title="Bilibili" rel="external nofollow noopener noreferrer"><i class="fas iconfont icon-bilibili"></i></a></div><div id="mj-footer"><div class="footer-group"><h3 class="footer-title">关于</h3><div class="footer-links"><a class="footer-item" target="_blank" rel="external nofollow noopener noreferrer" href="https://www.justlovesmile.top/">个人主页</a><a class="footer-item" href="/donate/">赞赏博主</a><a class="footer-item" href="/update/">博客日志</a><a class="footer-item" href="/charts/">博客统计</a></div></div><div class="footer-group"><h3 class="footer-title">归档</h3><div class="footer-links"><a class="footer-item" href="/archives/">文章归档</a><a class="footer-item" href="/tags/">全部标签</a><a class="footer-item" href="/categories/">全部分类</a><a class="footer-item" href="/random/">随机文章</a></div></div><div class="footer-group"><h3 class="footer-title">导航</h3><div class="footer-links"><a class="footer-item" href="/guestbook/">博客留言</a><a class="footer-item" href="/friends/">友情链接</a><a class="footer-item" href="/fcircle/">友链订阅</a><a class="footer-item" href="/atom.xml">RSS订阅</a></div></div><div class="footer-group"><h3 class="footer-title">协议</h3><div class="footer-links"><a class="footer-item" href="/privacy/">隐私协议</a><a class="footer-item" href="/cookies/">Cookies</a><a class="footer-item" href="/cc/">版权协议</a></div></div></div><div id="footer-banner"><div class="footer-banner-links"><div class="footer-banner-left"><div id="footer-banner-tips">©2019 - 2022 By Justlovesmile</div></div><div class="footer-banner-right"><a class="footer-banner-link" target="_blank" rel="external nofollow noopener noreferrer" href="http://beian.miit.gov.cn/">蜀ICP备20004960号</a><a class="footer-banner-link" href="/update/">主题</a><a class="footer-banner-link" href="/about/">关于</a></div></div></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i> <span>数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"></div></div><hr><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script defer="defer" src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script defer="defer" src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script defer="defer" src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script defer="defer" src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script defer="defer" src="/js/search/local-search.js"></script><div class="js-pjax"><script>(()=>{const t=()=>{twikoo.init(Object.assign({el:"#twikoo-wrap",envId:"blog-comment-3gt33nkmf9f97e6e",region:"ap-shanghai",onCommentLoaded:function(){btf.loadLightbox(document.querySelectorAll("#twikoo .tk-content img:not(.vemoji)"))}},null))},o=()=>{"object"!=typeof twikoo?getScript("https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js").then(t):setTimeout(t,0)};btf.loadComment(document.getElementById("twikoo-wrap"),o)})()</script></div><canvas id="universe"></canvas><script defer="defer">console.log("\n %c 欢迎来到Justlovesmile の Blog %c https://github.com/Justlovesmile %c https://blog.justlovesmile.top \n","color: #f9ed69; background: #252a34; padding:5px 0;","background: #3fc1c9; padding:5px 0;","background: #3fc1c9; padding:5px 0;")</script><script defer="defer" src="/js/rgbaster.min.js"></script><script defer="defer" src="/js/justlovesmile.js"></script><script>window.addEventListener("load",async()=>{navigator.serviceWorker.register("/js/sw-cdn.js?time="+(new Date).getTime()).then(async e=>{"true"!=window.localStorage.getItem("install")&&(window.localStorage.setItem("install","true"),setTimeout(()=>{window.location.search="?time="+(new Date).getTime()},1e3))}).catch(e=>{console.log("sw-cdn.js error")})})</script></div></body></html>